package com.mxpio.erp.common.purchase.entity;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.mxpio.erp.common.jpa.model.BizOrder;
import com.mxpioframework.security.annotation.Dict;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_PURC_PO")
@ApiModel(value="采购订单")
public class PurchaseOrder extends BizOrder {

	private static final long serialVersionUID = 1L;

	@Column(name = "ORDER_TYPE_")
	@ApiModelProperty(value = "单据类型")
	@Dict(dicCode="ERP_PURC_ORDER_TYPE")
	private String orderType ;

	@ApiModelProperty(value = "供应商编码")
	@Column(name = "SUPPLIER_CODE_")
	private String supplierCode;

	@ApiModelProperty(value = "供应商名称")
	@Column(name = "SUPPLIER_NAME_")
	private String supplierName;

	@ApiModelProperty(value = "供应商地址")
	@Column(name = "SUPPLIER_ADDRESS_")
	private String supplierAddress;

	@Column(name = "SALESMAN_")
	@ApiModelProperty(value = "业务员")
	private String salesman ;

	@Column(name = "CONTACTS_")
	@ApiModelProperty(value = "联系人")
	private String contacts ;

	@Column(name = "TELPHONE_")
	@ApiModelProperty(value = "电话")
	private String telphone ;

	@Column(name = "CONTRACT_NO_")
	@ApiModelProperty(value = "合同编号")
	private String contractNo ;

	@Column(name = "MEMO_")
	@ApiModelProperty(value = "备注")
	private String memo;
	
	@Transient
	private List<PurchaseOrderLine> purchaseOrderLine;
	
	@Override
	public String initTypeCode() {
		return "PO1";
	}
}
